/**
 * Sybil Project Management
 * 
 * Sybil is an client/server-based application for managing projects and
 * resources.
 * 
 * Copyright (C) 2009 Natascha Chrobok <nat@sybil-pm.org>
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */

package org.sybil_pm.util;

import java.util.Date;
import java.util.GregorianCalendar;

public class Period {

	private GregorianCalendar start;
		
	private GregorianCalendar end;
	

	public Period () {	}
	
	
	public Period (GregorianCalendar start, GregorianCalendar end) {
		this.start = start;
		this.end = end;		
	}
	
	
	
	
	public long getDaysBetween() {
		
		Date startDate = start.getTime();
		Date endDate = end.getTime();
		
		return (endDate.getTime() - startDate.getTime())/86400000; //resembles 1000 * 60 * 60 * 24
		
	}

	public GregorianCalendar getStart() {
		return start;
	}

	public void setStart(GregorianCalendar start) {
		this.start = start;
	}

	public GregorianCalendar getEnd() {
		return end;
	}

	public void setEnd(GregorianCalendar end) {
		this.end = end;
	}
		
	
}
